<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\UserRole
 *
 * @property int $id
 * @property string|null $name
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property string|null $slug
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\UserRole whereSlug($value)
 */
class UserRole extends Model
{

    protected $table='user_role';

    public static function getSelectOptions()
    {
        $options = \DB::table('user_role')->select('id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
